package shop

import (
	"RMS/app/shop/handler"
	"RMS/common/http"
	"github.com/gin-gonic/gin"
)

func InitRouter(engine *gin.Engine) {
	group := engine.Group("/app/shop")
	{
		group.GET("item_list", http.HandlerFuncAdapter(handler.ItemList))
		group.GET("order_list", http.HandlerFuncAdapter(handler.OrderList))
		group.GET("package_list", http.HandlerFuncAdapter(handler.PackageList))
		group.GET("cart_list", http.HandlerFuncAdapter(handler.CartList))
		group.GET("category_list", http.HandlerFuncAdapter(handler.CategoryList))
		group.GET("table_list", http.HandlerFuncAdapter(handler.TableList))

		group.POST("add_item", http.HandlerFuncAdapter(handler.AddItem))
		group.POST("add_package", http.HandlerFuncAdapter(handler.AddPackage))
		group.POST("add_order", http.HandlerFuncAdapter(handler.AddOrder))
		group.POST("add_cart", http.HandlerFuncAdapter(handler.AddCart))
		group.POST("add_category", http.HandlerFuncAdapter(handler.AddCategory))
		group.POST("add_table", http.HandlerFuncAdapter(handler.AddTable))

		group.POST("upd_item", http.HandlerFuncAdapter(handler.UpdateItem))
		group.POST("upd_package", http.HandlerFuncAdapter(handler.UpdatePackage))
		group.POST("upd_category", http.HandlerFuncAdapter(handler.UpdateCategory))
		group.POST("upd_table", http.HandlerFuncAdapter(handler.UpdateTable))

		group.POST("del_item", http.HandlerFuncAdapter(handler.DeleteItem))
		group.POST("del_package", http.HandlerFuncAdapter(handler.DeletePackage))
		group.POST("del_category", http.HandlerFuncAdapter(handler.DeleteCategory))
		group.POST("del_cart", http.HandlerFuncAdapter(handler.DeleteCart))
		group.POST("del_table", http.HandlerFuncAdapter(handler.DeleteTable))
		group.POST("del_order", http.HandlerFuncAdapter(handler.DeleteOrder))

		group.POST("baobiao_query", http.HandlerFuncAdapter(handler.BaobiaoQuery))
	}
}
